﻿namespace System.ComponentModel.Composition.SilverlightControlExtensions.Infrastructure
{
    using System.ComponentModel.Composition.Hosting;
    using System.ComponentModel.Composition.Primitives;

    public class XapCatalog : XamlCatalog
    {
        public override ComposablePartCatalog InnerCatalog
        {
            get
            {
                var dp = new DeploymentCatalog(
                    this.Xap.Contains(".xap") ? this.Xap : string.Format("{0}.xap", this.Xap));
                return dp;
            }
        }

        public string Xap { get; set; }
    }
}